<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>文件上传下载</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <script src="../layui/layui.js"></script>
    <script src="../js/comm-Fixed-termDeposits.js"></script>
    <link rel="stylesheet" href="../css/basic.css">
</head>

<body>
    <div style="width: 85%;margin: 0 auto">
        <!-- fm-basic负责使表格居中 -->
        <form class="layui-form">
            <h2 style="display: inline-block;">文件上传与下载</h2>
            <div style="display: inline-block;float: right;">
                <button class="layui-btn layui-btn-sm layui-btn-normal">上传</button>
                <button class="layui-btn layui-btn-sm layui-btn-normal">下载</button>
            </div>

            <table id="downloadAndUpload" class="layui-hide fm-basic"></table>
        </form>
    </div>
</body>
<script>
    layui.use('table', function () {
        var table = layui.table;
        //第一个实例
        table.render({
            elem: '#downloadAndUpload',
            
            // url: '/demo/table/user/' //数据接口
            page: true, //开启分页
            cols: [
                [ //表头
                    {
                        field: 'id',
                        title: '文件名',
                        width: '30%',
                    }, {
                        field: 'username',
                        title: '上传时间',
                        width: '30%'
                    }, {
                        field: 'sex',
                        title: '内容',
                        width: '39.9%',
                    },
                ]
            ],
            data: [{
                "id": "两学一做",
                "username": "2018-10-01",
                "sex": "xianxin@layui.com",
            }]


        });

    });
</script>

</html>